package com.gitee.starblues.grape.core.builder;


import com.gitee.starblues.grape.core.domain.user.RebateAccount;
import com.gitee.starblues.grape.repository.databases.entity.RebateAccountPo;
import com.gitee.starblues.grape.repository.databases.entity.RebateDrawLogPo;
import org.springframework.beans.BeanUtils;

public class RebateAccountBuilder {
	public static RebateAccount build(RebateAccountPo source) {
		RebateAccount entity = new RebateAccount();
		BeanUtils.copyProperties(source, entity);
		return entity;
	}
	
	public static RebateAccountPo buildDarw(RebateDrawLogPo drawLogPo) {
		RebateAccountPo account = new RebateAccountPo();
		account.setTotalAmount(drawLogPo.getAmount());
		account.setAvailableBalance(drawLogPo.getAmount());
		account.setUserId(drawLogPo.getUserId());
		return account;
	}

}
